package sartoservicesync;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import sartoservicesync.connectors.PrestaConnector;
import sartoservicesync.connectors.RakutenConnector;

public class Starter {
	static final Logger logger = LoggerFactory.getLogger(Starter.class);
	
	public static void main(String[] args) {
//		logger.debug("Starte Datenabholung aus Prestashop und Rakuten");	
//		long startTime = System.currentTimeMillis();
//		loadPrestashopData();
//		loadRakutenData();
//		long duration = System.currentTimeMillis()-startTime;
//		logger.debug("Datenabholung aus Prestashop und Rakuten beendet, Gesamtdauer: {}ms",duration);
		SartoService.SyncCategoriesPrestaToRakuten();
	}

	private static void loadRakutenData() {
		logger.debug("Starte Datenabholung aus Rakuten");	
		long startTime = System.currentTimeMillis();
		RakutenConnector rakutenConnector = new RakutenConnector();
		rakutenConnector.loadFullCategoriesList();
//		rakutenConnector.loadOrdersList();
		long duration = System.currentTimeMillis()-startTime;
		logger.debug("Datenabholung aus Rakuten beendet, Dauer: {}ms",duration);	
	}

	private static void loadPrestashopData() {
		logger.debug("Starte Datenabholung aus Prestashop");
		PrestaConnector prestaConnector = new PrestaConnector();

		long startTime = System.currentTimeMillis();
//		prestaConnector.loadRakutenCustomer();
//		prestaConnector.loadFullCustomersList();
		prestaConnector.loadFullCategoriesList();
//		prestaConnector.loadFullProductList();
		long duration = System.currentTimeMillis()-startTime;
		logger.debug("Datenabholung aus Prestashop beendet, Dauer: {}ms",duration);		
	}



}
